package xyz.hzxiao.controller;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.hzxiao.base.AbstractResult;
import xyz.hzxiao.result.JsonResult;

/**
 * @Author: scy
 * @Date: 2022-09-02 15:46
 */
@RestController
public class DefaultCircuitBreakController {

    @RequestMapping("/globalFallback")
    public AbstractResult<Object> globalFallback() {
        return JsonResult
                .builder()
                .setSuccess(Boolean.FALSE)
                .setCode(HttpStatus.SERVICE_UNAVAILABLE.value())
                .setMessage("服务器迷路了，稍后尝试一下吧 `(*>﹏<*)′")
                .build();
    }
}
